<template>
  <div class="home">
    <h1>LOGO</h1>
    <van-form @submit="onSubmit">
    <van-field
      v-model="username"
      name="用户名"
      label="用户名"
      placeholder="用户名"
      :rules="[{ required: true, message: '请填写用户名' }]"
    />
    <van-field
      v-model="password"
      type="password"
      name="密码"
      label="密码"
      placeholder="密码"
      :rules="[{ required: true, message: '请填写密码' }]"
    />
    <p class="btns"><span>忘记密码？</span><span @click="toRegister()">立即注册</span></p>
    <div style="margin: 16px;">
      <van-button round block type="info" native-type="submit">登录</van-button>
    </div>
  </van-form>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component
export default class Home extends Vue {
    private username:any=''
    private password:any=''
    $router: any;
    onSubmit(values) {
        console.log('submit', values);
      }
    toRegister(){
      this.$router.push({path:'/register'})
    }
}
</script>

<style lang="scss" scoped>
  .home{
    width: 100%;
    height: 100%;
    h1{
      width: 100%;
      line-height: 200px;
      font-size: 50px;
      text-align: center;
    }
    .btns{
      width: 100%;
      height: 100px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0  100px;
      span{
        color: dodgerblue;
      }
    }
  }
</style>
